<template>
  <div>
  
    <div  @click="showPickerfn">ss</div>


    <div class="page">
   <transition name="picker">
        <div class="picker" v-show="showPicker">
            <p class="picker-item bottom_link">选项</p>
            <p class="picker-item bottom_link">选项</p>
            <p class="picker-item bottom_link">选项</p>
            <p class="picker-item bottom_link">选项</p>
            <p class="picker-item bottom_link">选项</p>
            <p class="picker-item bottom_link">选项</p>
            <p class="picker-item bottom_link">选项</p>
            <p class="picker-item bottom_link">选项</p>
            <p class="picker-item bottom_link">选项</p>
            <p class="picker-item bottom_link">选项</p>
        </div>
    </transition>
</div>

  </div>
</template>

<script>
 export default {
    name: "Login",
    data() {
      return {
        handleClose:function name(params) {
          return console.log('s');
        },
        form: {
          username: '',
          password: ''
        },

        // 表单验证，需要在 el-form-item 元素中增加 prop 属性
        rules: {
          username: [
            {required: true, message: '账号不可为空', trigger: 'blur'}
          ],
          password: [
            {required: true, message: '密码不可为空', trigger: 'blur'}
          ]
        },

        // 对话框显示和隐藏
        dialogVisible: false,
          showPicker: false
      }
    },
    methods: {
      onSubmit(formName) {
        // 为表单绑定验证功能
        this.$refs[formName].validate((valid) => {
          if (valid) {
            // 使用 vue-router 路由到指定页面，该方式称之为编程式导航
            this.$router.push("/profile");
          } else {
            this.dialogVisible = true;
            return false;
          }
        });
      },
        showPickerfn() {
                this.showPicker = !this.showPicker
            },
            closePicker() {
                this.showPicker = this.showPicker   
                console.log('s');
                }
    }
  }
</script>

<style lang="scss" scoped>
.page{
  position: fixed;
  left: 50%;
  top: 50%;
  background-color: red;
  height: 200px;
  width: 200ps;
}
.picker {
   height: 300px;
    background: #fff;
    width: 100%;
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 2020;
    overflow-y: scroll;
    box-shadow: 0 0 12px 0 #f4f4f4;
}
.picker-item {
    font-size: 14px;
    padding: 15px;
    text-align: center;
}
/* 容器 高度进入和离开 的过渡动画 */
.picker-enter-active,.picker-leave-active{
    transition: height .15s;
}
/* 定义进入过渡的开始状态 和 离开过渡的结束状态 */
.picker-enter,.picker-leave-to{
    height: 0;
}
/* 定义进入过渡的结束状态 和 离开过渡的开始状态 */
.picker-enter-to,.picker-leave {
    height: 270px;
}






  .login-box {
    border: 1px solid #DCDFE6;
    width: 350px;
    margin: 180px auto;
    padding: 35px 35px 15px 35px;
    border-radius: 5px;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    box-shadow: 0 0 25px #909399;
  }

  .login-title {
    text-align: center;
    margin: 0 auto 40px auto;
    color: #303133;
  }
</style>